<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>
          Google Web Toolkit
          
            -
            Panel</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<link href="../css/base.css" rel="stylesheet" type="text/css">
<link href="./doc.css" rel="stylesheet" type="text/css">
<link href="../css/print.css" rel="stylesheet" media="print" type="text/css">
</head>
<body>
<div id="gaia">&nbsp;</div>
<div id="header">
<div id="logo">
<a href="http://code.google.com/"><img src="http://code.google.com/images/code_sm.png" alt="Google"></a>
</div>
<div id="title">Google Web Toolkit (Beta)</div>
<div id="breadcrumbs">
<div id="nextprev">
<nobr><a href="com.google.gwt.user.client.ui.NamedFrame.html">&laquo; prev</a></nobr><nobr><a href="com.google.gwt.user.client.ui.PasswordTextBox.html">next &raquo;</a></nobr>
</div>
<span class="item"><a href="http://code.google.com/">Google Code Home</a></span>
        &gt;
        <span class="item"><a href="http://code.google.com/webtoolkit/">Google Web Toolkit</a></span>
        &gt;
        
        <span class="item"><a xmlns="" href="gwt.html">GWT Class Reference</a></span> &gt;
            <span class="item"><a href="com.google.gwt.user.client.ui.html">com.google.gwt.user.client.ui</a></span> &gt;
            <span class="selected item">Panel</span>
</div>
</div>
<div id="side">
<div id="menu">
<h4>
<a href="http://code.google.com/webtoolkit/">Google Web Toolkit</a>
</h4>
<ul>
<li>
<a href="http://code.google.com/webtoolkit/download.html">Download GWT</a>
</li>
</ul>
<ul>
<li>
<a href="http://code.google.com/webtoolkit/overview.html">Product Overview</a>
</li>
<li>
<a href="http://code.google.com/webtoolkit/gettingstarted.html">Getting Started Guide</a>
</li>
<li>
<a href="http://code.google.com/webtoolkit/documentation/examples/">Example Projects</a>
</li>
</ul>
<ul>
<li>
<a href="./com.google.gwt.doc.DeveloperGuide.html">Developer Guide</a>
</li>
<li>
<a class="selected" href="./gwt.html">Class Reference</a>
</li>
<li>
<a href="http://code.google.com/webtoolkit/issues/">Issue Tracking</a>
</li>
<li>
<a href="http://groups.google.com/group/Google-Web-Toolkit">Developer Forum</a>
</li>
</ul>
<ul>
<li>
<a href="http://googlewebtoolkit.blogspot.com/">GWT Blog</a>
</li>
<li>
<a href="http://code.google.com/webtoolkit/faq.html">GWT FAQ</a>
</li>
<li>
<a href="http://code.google.com/webtoolkit/makinggwtbetter.html">Making GWT Better</a>
</li>
</ul>
<ul>
<li>
<a href="http://code.google.com/webtoolkit/thirdparty.html">Third Party Tools</a>
</li>
</ul>
</div>
<div id="search">
<form action="http://www.google.com/search" method="get">
<div>
<input name="domains" value="code.google.com" type="hidden"><input name="sitesearch" value="code.google.com" type="hidden">
<div class="header">Search this site:</div>
<div class="input">
<input name="q" size="10">
</div>
<div class="button">
<input value="Search" type="submit">
</div>
</div>
</form>
</div>
</div>
<div xmlns="http://www.w3.org/1999/xhtml" id="body">
<h1>Class Panel</h1>
<div class="classSig">public 
            class 
            Panel<br>extends
                <a xmlns="" href="com.google.gwt.user.client.ui.Widget.html">Widget</a>
<br>implements 
                <a href="com.google.gwt.user.client.ui.HasWidgets.html">HasWidgets</a>
<br>
<br>// Superclass of <code><a href="com.google.gwt.user.client.ui.ComplexPanel.html">ComplexPanel</a></code>, <code><a href="com.google.gwt.user.client.ui.HTMLTable.html">HTMLTable</a></code>, <code><a href="com.google.gwt.user.client.ui.SimplePanel.html">SimplePanel</a></code>
</div>Abstract base class for all panels, which are widgets that can contain other
 widgets.<h2 class="api">Methods</h2>
<table cellpadding="1" cellspacing="1" class="members">
<tr>
<td><a href="com.google.gwt.user.client.ui.Panel.html#add(com.google.gwt.user.client.ui.Widget)">add(Widget)</a></td><td>Adds a child widget. </td>
</tr>
<tr>
<td><a href="com.google.gwt.user.client.ui.Panel.html#adopt(com.google.gwt.user.client.ui.Widget, com.google.gwt.user.client.Element)">adopt(Widget, Element)</a></td><td>This method must be called as part of the add method of any panel. </td>
</tr>
<tr>
<td><a href="com.google.gwt.user.client.ui.Panel.html#clear()">clear()</a></td><td>Removes all child widgets. </td>
</tr>
<tr>
<td><a href="com.google.gwt.user.client.ui.Panel.html#disown(com.google.gwt.user.client.ui.Widget)">disown(Widget)</a></td><td>This method must be called whenever a Widget is removed. </td>
</tr>
<tr>
<td><a href="com.google.gwt.user.client.ui.Panel.html#onAttach()">onAttach()</a></td><td>This method is called when a widget is attached to the browser's document. </td>
</tr>
<tr>
<td><a href="com.google.gwt.user.client.ui.Panel.html#onDetach()">onDetach()</a></td><td>This method is called when a widget is detached from the browser's
 document. </td>
</tr>
</table>
<h2 class="api">Method Detail</h2>
<a name="add(com.google.gwt.user.client.ui.Widget)"></a>
<h3 class="api">add</h3>
<div class="memberSig">public void<b> add</b>(<nobr><a href="com.google.gwt.user.client.ui.Widget.html">Widget</a> w</nobr>)</div>Adds a child widget.<h4 class="api">Parameters</h4>
<dl class="memberDetail">
<dt>w</dt>
<dd>the widget to be added</dd>
</dl>
<hr>
<a name="adopt(com.google.gwt.user.client.ui.Widget, com.google.gwt.user.client.Element)"></a>
<h3 class="api">adopt</h3>
<div class="memberSig">protected void<b> adopt</b>(<nobr><a href="com.google.gwt.user.client.ui.Widget.html">Widget</a> w, </nobr><nobr><a href="com.google.gwt.user.client.Element.html">Element</a> container</nobr>)</div>This method must be called as part of the add method of any panel. It
 ensures that the Widget's parent is set properly, and that it is removed
 from any existing parent widget. It also attaches the child widget's
 DOM element to its new container, ensuring that this process occurs in the
 right order.<h4 class="api">Parameters</h4>
<dl class="memberDetail">
<dt>w</dt>
<dd>the widget to be adopted</dd>
<dt>container</dt>
<dd>the element within which it will be contained</dd>
</dl>
<hr>
<a name="clear()"></a>
<h3 class="api">clear</h3>
<div class="memberSig">public void<b> clear</b>()</div>Removes all child widgets.<hr>
<a name="disown(com.google.gwt.user.client.ui.Widget)"></a>
<h3 class="api">disown</h3>
<div class="memberSig">protected void<b> disown</b>(<nobr><a href="com.google.gwt.user.client.ui.Widget.html">Widget</a> w</nobr>)</div>This method must be called whenever a Widget is removed. It ensures that
 the Widget's parent is cleared.<h4 class="api">Parameters</h4>
<dl class="memberDetail">
<dt>w</dt>
<dd>the widget to be disowned</dd>
</dl>
<hr>
<a name="onAttach()"></a>
<h3 class="api">onAttach</h3>
<div class="memberSig">protected void<b> onAttach</b>()</div>This method is called when a widget is attached to the browser's document.
 It must not be overridden, except by <a href="com.google.gwt.user.client.ui.Panel.html">Panel</a>. To receive
 notification when a widget is attached to the document, override the
 <a href="com.google.gwt.user.client.ui.Widget.html#onLoad()">onLoad</a> method.<hr>
<a name="onDetach()"></a>
<h3 class="api">onDetach</h3>
<div class="memberSig">protected void<b> onDetach</b>()</div>This method is called when a widget is detached from the browser's
 document. It must not be overridden, except by <a href="com.google.gwt.user.client.ui.Panel.html">Panel</a>.</div>
<div id="footer" xmlns="http://www.w3.org/1999/xhtml">
          &copy;2007 Google
          <span class="noprint">
            -
            <a href="http://www.google.com/">Google Home</a>
            -
            <a href="http://www.google.com/jobs/">We're Hiring</a>
            -
            <a href="http://www.google.com/privacy.html">Privacy Policy</a>
            -
            <a href="http://www.google.com/terms_of_service.html">Terms of Service</a>
            -
            <a href="mailto:code@google.com">Contact Us</a></span>
<div id="license" style="text-align: center; margin: 1em 0em 1em 0em">
            Except as otherwise
            <a href="http://code.google.com/policies.html#restrictions">noted</a>, the content of this  page is licensed under the  <a rel="license" href="http://creativecommons.org/licenses/by/2.5/">Creative Commons Attribution 2.5 License</a>.
              <!--
            <rdf:RDF xmlns="http://web.resource.org/cc/">
<Work rdf:about="">
<license rdf:resource="http://creativecommons.org/licenses/by/2.5/"></license>
</Work>
<License rdf:about="http://creativecommons.org/licenses/by/2.5/">
<permits rdf:resource="http://web.resource.org/cc/Reproduction"></permits>
<permits rdf:resource="http://web.resource.org/cc/Distribution"></permits>
<requires rdf:resource="http://web.resource.org/cc/Notice"></requires>
<requires rdf:resource="http://web.resource.org/cc/Attribution"></requires>
<permits rdf:resource="http://web.resource.org/cc/DerivativeWorks"></permits>
</License>
</rdf:RDF>
              -->
            </div>
</div>
<script src="https://ssl.google-analytics.com/urchin.js" type="text/javascript" xmlns="http://www.w3.org/1999/xhtml"></script><script type="text/javascript">
          _uacct="UA-18071-1"; _uanchor=1; urchinTracker();
        </script>
</body>
</html>
